package xmlService;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

import beans.EntidadBean;
import beans.RodamientoBean;
import beans.SolicitudCotizacionBean;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;

import controller.ControllerPrincipal;

public class SolicitudCotizacionXmlService {

	

	public static SolicitudCotizacionBean cargarSolicitudCotizacion()
	{
		SolicitudCotizacionBean c = null;
		
		XStream xstream = new XStream( new DomDriver());
		xstream.autodetectAnnotations(true);  
		
		xstream.alias("SolicitudCotizacion", SolicitudCotizacionBean.class);

		FileInputStream fis;
		try {
			fis = new FileInputStream("src/XML/SolicitudCotizacion.xml");
			c = (SolicitudCotizacionBean) xstream.fromXML(fis);
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return c;				
	}
	
}
